import {createSSRApp} from "vue";
import App from "./App.vue";
import aiRequest from './pages/index/utils/request/request.js'
import { 
	navTo, 
	navBack, 
	wxPay, 
	isLogin, 
	isArray, 
	isEmpty, 
	isEmptyObject, 
	isObject, 
	checkInput, 
	getWeek, 
	Trim, 
	readySubmit, 
	spmFun, 
	getUserInfo, 
	shareStatistical, 
	productUrlJump, 
	detailClick,
	openLocation,
	poiClick,
	reservationNotice ,
	playAudio, 
	createPlayAudio, 
	formatDatetoString,
	formatDatetoObj,
	shareFun
} from './pages/index/utils/common.js'


import store from '@/store/index'

export function createApp() {
    const app = createSSRApp(App);
    app.use(store)
    app.config.globalProperties.$aiRequest = aiRequest
    app.config.globalProperties.$spmFun = spmFun
    app.config.globalProperties.$getUserInfo = getUserInfo
	app.config.globalProperties.$navTo = navTo
	app.config.globalProperties.$navBack = navBack
	app.config.globalProperties.$wxPay = wxPay
	app.config.globalProperties.$isArray = isArray
	app.config.globalProperties.$isEmpty = isEmpty
	app.config.globalProperties.$isEmptyObject = isEmptyObject
	app.config.globalProperties.$isLogin = isLogin
	app.config.globalProperties.$isObject = isObject
	app.config.globalProperties.$checkInput = checkInput
	app.config.globalProperties.$getWeek = getWeek
	app.config.globalProperties.$Trim = Trim
	app.config.globalProperties.$readySubmit = readySubmit
	app.config.globalProperties.$spmFun = spmFun
	app.config.globalProperties.$getUserInfo = getUserInfo
	app.config.globalProperties.$shareStatistical = shareStatistical
	app.config.globalProperties.$productUrlJump = productUrlJump
	app.config.globalProperties.$detailClick = detailClick
	app.config.globalProperties.$openLocation = openLocation
	app.config.globalProperties.$poiClick = poiClick
	app.config.globalProperties.$reservationNotice = reservationNotice
	app.config.globalProperties.$playAudio = playAudio
	app.config.globalProperties.$createPlayAudio = createPlayAudio
	app.config.globalProperties.$formatDatetoString = formatDatetoString
	app.config.globalProperties.$formatDatetoObj = formatDatetoObj
	app.config.globalProperties.$shareFun = shareFun
    app.config.globalProperties.$store = store
    return {
        app,
    };
}
